mod json_parse;
mod net_layer;
mod app_layer;
mod doip_layer;

use std::error::Error;
use json_parse::CfgInfo;

fn main() -> Result<(), Box<dyn Error>> 
{
    let file_path = "doip_param.json";
    let doip_param = CfgInfo::parse_and_build(file_path)?;

    let version = "v1.0.5";
    println!("doip server version:{}" , version);
    net_layer::task_start(&doip_param).unwrap_or_else(|err| {
        eprintln!("net_layer error: {}", err);
    });
    Ok(())
}
